package com.zrf.gulimall.order.web;

import com.alipay.api.AlipayApiException;
import com.zrf.gulimall.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author zhanrf
 * @Date 2022/1/9 16:23
 */
@Controller
public class PayWebController {
	@Autowired
	private OrderService orderService;

	@ResponseBody
	@GetMapping(value = "/aliPayOrder", produces = "text/html")
	public String pay(@RequestParam("orderSn") String orderSn) throws AlipayApiException {
		return orderService.pay(orderSn);
	}
}
